#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 7;
int n, m, a[M], ans = 0, sum = 0;

int main()
{
	cin >> n >> m;
	for (int i = 1; i <= n; i++)
	{
		cin >> a[i];
		if (a[i] + sum <= m)
		{
			sum += a[i];
		}
		else
		{
			sum = a[i];
			ans++;
		}
	}
	cout << ans + 1;
	return 0;
}